{// 引入标签库 }
<tagLib name="html" />
<include file="Public:header" />
<script type="text/javascript" src="__TMPL__Common/js/calendar/calendar.php?lang=zh-cn" ></script>
<load href='__TMPL__Common/js/calendar/calendar.css' />
<load href='__TMPL__Common/js/calendar/calendar.js' />
<php>
	function get_user_diamonds($user_id)
	{
		return M("User")->where("id=".intval($user_id))->getField("diamonds");
	}
	function to_user_list($user_id)
	{
		return '<a href="'.U('UserGeneral/index',array('id'=>$user_id)).'">'.$user_id.'</a>';
	}
	function get_promoter_two($child_count,$pid)
	{
		if($child_count >0)	{
			return $child_count.'<a href="'.U('BmPromoterTwo/index',array('p_promoter_id'=>$pid)).'">明细</a>';
		}else{
			return $child_count;
		}

	}
</php>
<script>
</script>
<div class="main">
<div class="main_title_list"><div class="list-line-ico"></div>一级单位列表</div>
<div class="search_row">
	<form name="search" action="__APP__" method="get">
		<div>一级单位ID：<input type="text" style="width:60px;" class="textbox" name="id" value="{:trim($_REQUEST['id'])}" /></div>
		<div>一级单位名称：<input type="text" class="textbox" name="name" value="{:trim($_REQUEST['name'])}" /></div>
		<div>手机号：<input type="text" style="width:80px;" class="textbox" name="mobile" value="{:trim($_REQUEST['mobile'])}" /></div>
		<div>创建时间：
			<span><input type="text" class="textbox" name="create_time_1" id="create_time_1" value="{$_REQUEST['create_time_1']}" onfocus="this.blur(); return showCalendar('create_time_1', '%Y-%m-%d', false, false, 'btn_create_time_1');" /><input type="button" class="button" id="btn_create_time_1" value="{%SELECT_TIME}" onclick="return showCalendar('create_time_1', '%Y-%m-%d', false, false, 'btn_create_time_1');" /></span>
			- <span><input type="text" class="textbox" name="create_time_2" id="create_time_2" value="{$_REQUEST['create_time_2']}" onfocus="this.blur(); return showCalendar('create_time_2', '%Y-%m-%d', false, false, 'btn_create_time_2');" /><input type="button" class="button" id="btn_create_time_2" value="{%SELECT_TIME}" onclick="return showCalendar('create_time_2', '%Y-%m-%d', false, false, 'btn_create_time_2');" /></span>
			<input type="hidden" value="BmPromoterOne" name="m" />
			<input type="hidden" value="index" name="a" />
			<input type="submit" class="button" value="{%SEARCH}" />
		</div>

	</form>
</div>
<html:list
	id="dataTable"
	style="dataTable"
	name="data"
	checkbox="true"
	action="true"
	datasource="list"
	show="
	,id:一级单位ID|100px
	,name:一级单位名称:edit
	,mobile:手机号
	,user_id|to_user_list:绑定会员ID
	,user_id|get_user_diamonds:钻石数
	,child_count|get_promoter_two=$data['id']:发展二级单位/人
	,create_time|to_date:{%CREATE_TIME}
	,is_effect|get_is_effect=$data['id']:{%IS_EFFECT}"
	actionlist="edit:{%EDIT}" />
	<table class="dataTable">
		<tbody>
			<td colspan="9">
				<input type="button" class="button button-add" value="{%ADD}" onclick="add();" />
			</td>
		</tbody>
	</table>
<div class="page">{$page}</div>
</div>
<include file="Public:footer" />